﻿<phone:PhoneApplicationPage 
    x:Class="wallstreet.Control_MyStocks"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
    xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    FontFamily="{StaticResource PhoneFontFamilyNormal}"
    FontSize="{StaticResource PhoneFontSizeNormal}"
    Foreground="{StaticResource PhoneForegroundBrush}"
    SupportedOrientations="Portrait" Orientation="Portrait"
    mc:Ignorable="d" d:DesignHeight="768" d:DesignWidth="480"
    shell:SystemTray.IsVisible="True"
    xmlns:datavis="clr-namespace:System.Windows.Controls.DataVisualization;assembly=System.Windows.Controls.DataVisualization.Toolkit"
    xmlns:charting="clr-namespace:System.Windows.Controls.DataVisualization.Charting;assembly=System.Windows.Controls.DataVisualization.Toolkit"
    xmlns:chartingprimitives="clr-namespace:System.Windows.Controls.DataVisualization.Charting.Primitives;assembly=System.Windows.Controls.DataVisualization.Toolkit"
    xmlns:local="clr-namespace:wallstreet"
    Loaded="PhoneApplicationPage_Loaded">

    <UserControl.Resources>
        <Style x:Key="PanoramaTextBlock" TargetType="TextBlock">
            <Setter Property="Foreground" Value="White"/>
            <Setter Property="FontSize" Value="40"/>
        </Style>

        <Style x:Key="PanoramaTextListBox" TargetType="ListBox">
            <Setter Property="ItemContainerStyle">
                <Setter.Value>
                    <Style TargetType="ListBoxItem">
                        <Setter Property="Template">
                            <Setter.Value>
                                <ControlTemplate TargetType="ListBoxItem">
                                    <TextBlock Text="{Binding Name}"
                                               Style="{StaticResource PanoramaTextBlock}"/>
                                </ControlTemplate>
                            </Setter.Value>
                        </Setter>
                    </Style>
                </Setter.Value>
            </Setter>
        </Style>
    </UserControl.Resources>
    
    <Grid>
        <ListBox x:Name="lboMyStocks" HorizontalAlignment="Left" Width="400" SelectionChanged="lboMyStocks_SelectionChanged" >
            <ListBox.ItemTemplate>
                <DataTemplate>
                    <StackPanel Orientation="Vertical">
                        <TextBlock Text="{ Binding Company}" Style="{StaticResource PanoramaTextBlock}" />
                        <Grid>
                            <StackPanel Orientation="Horizontal" HorizontalAlignment="Left" Margin="0,0,0,20">
                                <TextBlock Text="{ Binding LastTrade}" Margin= "0,-10,0,0" Foreground="Gray" FontSize="30" Style="{StaticResource PanoramaTextBlock}"/>
                                <TextBlock Text="{ Binding Change}" Foreground="{ Binding Change_color}" Margin= "10,-10,0,0" FontSize="30" Style="{StaticResource PanoramaTextBlock}"/>
                            </StackPanel>
                        </Grid>
                    </StackPanel>
                </DataTemplate>
            </ListBox.ItemTemplate>
        </ListBox>

    </Grid>
</phone:PhoneApplicationPage>
